package com.you.atlas.web.place.module.screen;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.service.form.Group;
import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.dataresolver.FormGroup;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.atlas.biz.place.service.PlaceQueryService;
import com.you.place.dal.dao.dataobject.PlaceDO;

public class NoteAdd {

	@Autowired
	private PlaceQueryService placeQueryService;
	
	public void execute(@FormGroup("postNote") Group group,
			@Param("placeId") Long placeId,Context context,Navigator navigator) {
		
		PlaceDO placeDO =  placeQueryService.find(placeId);
		
		if(placeDO==null){
			navigator.redirectTo("placeModule").withTarget("error.vm");
			return;
		}
		
		context.put("placeDO", placeDO);
	}
}
